/**
 * Created On: Dec 22, 2012
 */
package com.athena.api.exam;

import java.util.List;
import java.util.Map;

import com.athena.dal.entities.Examination;
import com.athena.dal.entities.Examination.ExamType;

/**
 * Exam service
 * 
 * @author Ashish Kumar Sinha <aksinha.mail@gmail.com>
 * Version 1.0
 */
public interface IExamService {
	
	/**
	 * to create or update an instance of {@link Examination} in the database.
	 * 
	 * @param exam - a loaded instance of {@link Examination}
	 * 
	 * @return - the persisted instance
	 */
	public Examination createOrUpdate(Examination exam);
	
	/**
	 * 
	 * @param subjectId
	 * @param minutes
	 * @param examType
	 * @return
	 */
	public Examination create(final int subjectId, final int minutes, final ExamType examType);
	
	/**
	 * to find all instances of examination for a given subject
	 * 
	 * @param subjectId - the id of the subject
	 * 
	 * @return - the set of examination
	 */
	public List<Examination> findForSubject(final int subjectId);
	
	/**
	 * to find all instances of examinations for a given class, grouped on subject
	 * 
	 * @param classId - the class id
	 * @return - a map of subject and corresponding examinations for the given class.
	 */
	public Map<Integer, List<Examination>> findForClass(final int classId);
	
	/**
	 * to find all instances of examinations for a given faculty, grouped on subject
	 * 
	 * @param facultyId - the faculty id
	 * @return - a map of subject and corresponding examinations for the given faculty.
	 */
	public List<Examination> findForFaculty(final int facultyId);
}
